package com.dingwen.treasure.mybatisplus.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.dingwen.treasure.model.entity.mybatisplus.SysUser;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author dingwen
 * @description 针对表【sys_user(系统用户表)】的数据库操作Mapper
 * @createDate 2022-05-01 20:09:53
 * @Entity generator.domain.SysUser
 */
@Repository
public interface SysUserMapper extends BaseMapper<SysUser> {
    /**
     * 测试自定义分页：</br>
     * <p>注意：</p>
     * <ul>
     *     <li>方法第一个参数必须是page</li>
     *     <li>多个参数需要指定 @param</li>
     * </ul>
     *
     * @param page    页
     * @param deleted 删除
     * @return {@link E}
     */
    <E extends IPage<SysUser>> E testSelectPage(@Param("page") E page, @Param("deleted") Integer deleted);

    /**
     * 优化分页查询 </br>
     * <p>
     *     需要配合条件查询、总记录条数查询
     * </p>
     *
     * @param offset  偏移量
     * @param pageSize 页面大小
     * @return {@link List}<{@link SysUser}>
     */
    List<SysUser> optimizeSelectPage(@Param("offset") Integer offset, @Param("pageSize") Integer pageSize);

}




